//
//  AHFSIngerListCell.m
//  SlowPlay
//
//  Created by dllo on 15/10/21.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "AHFSIngerListCell.h"

@implementation AHFSIngerListCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSingerListCell];
    }
    return self;
}

- (void)createSingerListCell
{
    self.singerImage = [[UIImageView alloc] initWithFrame:CGRectZero];
        [self.contentView addSubview:self.singerImage];
//    (self.contentView.frame.size.width - 10) / 2
    self.singerImage.layer.cornerRadius = 35;
//            self.singerImage.clipsToBounds = YES;
    self.singerImage.layer.masksToBounds = YES;
    self.singerImage.contentMode = UIViewAnimationOptionAllowAnimatedContent;
    
    
    self.singerLabel = [[UILabel alloc] initWithFrame:CGRectZero];
    self.singerLabel.font = [UIFont systemFontOfSize:16];
    
    [self.contentView addSubview:self.singerLabel];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    [self.singerImage mas_makeConstraints:^(MASConstraintMaker *make) {
        
        
        
        make.left.equalTo(self.contentView.mas_left).with.offset(5);
        make.top.equalTo(self.contentView.mas_top).with.offset(5);
        make.bottom.equalTo(self.contentView.mas_bottom).with.offset(-5);
        make.width.mas_equalTo(self.contentView.frame.size.height - 10);
    }];
    

    
    
    
    [self.singerLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.singerImage.mas_right).with.offset(15);
        make.top.equalTo(self.contentView.mas_top).with.offset(5);
        make.bottom.equalTo(self.contentView.mas_bottom).with.offset(-5);
        make.right.equalTo(self.contentView.mas_right).with.offset(-5);
        make.width.mas_equalTo(self.contentView.frame.size.height - 10);
    }];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
